//
//  HBBondListTotalCell.m
//  HuoBao
//
//  Created by chaiyanan on 15/12/3.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "HBBondListTotalCell.h"

@implementation HBBondListTotalCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundColor = [LCCommon getColor:@"28292d"];
    
        [self createCustomView];
    }
    return self;
}

- (void)createCustomView
{
    self.totalIncome = [self createLableWithTextColor:[LCCommon getColor:@"fa9838"] font:[UIFont boldSystemFontOfSize:40.0f] text:@"12365.72" textAlignment:NSTextAlignmentCenter frame:CGRectMake(0, 23, SCREEN_WIDTH, 40) superView:self];
    
    UILabel *totalIncomeTitle = [self createLableWithTextColor:[LCCommon getColor:@"666666"] font:[UIFont boldSystemFontOfSize:15.0f] text:@"在投金额（元）" textAlignment:NSTextAlignmentCenter frame:CGRectMake(0, self.totalIncome.y+self.totalIncome.height, SCREEN_WIDTH, 15) superView:self];
    
//    UILabel *totalIncomeTitle =
    [self createLableWithTextColor:[LCCommon getColor:@"666666"] font:[UIFont boldSystemFontOfSize:12.0f] text:@"当借款人还款后，系统将自动为您匹配新的债权" textAlignment:NSTextAlignmentCenter frame:CGRectMake(0, totalIncomeTitle.y+totalIncomeTitle.height+27, SCREEN_WIDTH, 12) superView:self];
    
}

- (UILabel *)createLableWithTextColor:(UIColor *)color font:(UIFont *)font text:(NSString *)text textAlignment:(NSTextAlignment)textAlignment frame:(CGRect)frame superView:(UIView *)superView
{
    UILabel *lable = [[UILabel alloc]initWithFrame:frame];
    lable.textColor = color;
    lable.font = font;
    lable.text = text;
    lable.textAlignment = textAlignment;
    [superView addSubview:lable];
    return lable;
}

- (UILabel *)createContentWithTitle:(NSString *)title frame:(CGRect)frame superView:(UIView *)superView
{
    UIView *bgView = [[UIView alloc]initWithFrame:frame];
    bgView.backgroundColor = [UIColor clearColor];
    [superView addSubview:bgView];
    
    UILabel *lable = [self createLableWithTextColor:[LCCommon getColor:@"999999"] font:[UIFont systemFontOfSize:16.0f] text:@"140.80" textAlignment:NSTextAlignmentCenter frame:CGRectMake(0,0, bgView.width, 16) superView:bgView];
    [self createLableWithTextColor:[LCCommon getColor:@"666666"] font:[UIFont systemFontOfSize:12.0f] text:title textAlignment:NSTextAlignmentCenter frame:CGRectMake(0, lable.height+10, lable.width, 12) superView:bgView];
    
    return lable;
}

@end
